import React from 'react';
import './style/index.less';

import { Button } from 'antd';
import Log from "utils";
import BaseComponent from "components/Base/BaseComponent";

export default class MessageDemo extends BaseComponent{

  success = () => {
    this.showMsg('success', 'This is a this.showMsg of success');
  };

  error = () => {
    this.showMsg('error', 'This is a this.showMsg of error');
  };

  warning = () => {
    this.showMsg('warning', 'This is this.showMsg of warning');
  };

  chide = () => {
    const hide = this.showMsg('loading', 'Action in progress..', 0);
    // Dismiss manually and asynchronously
    setTimeout(hide, 2500);

    Log.debug('对话框隐藏hide', hide);
  }


  render() {
    return (
      <div>
        <Button onClick={this.success}>Success</Button>
        <Button onClick={this.error}>Error</Button>
        <Button onClick={this.warning}>Warning</Button>
        <Button onClick={this.chide}>手动控制消失</Button>
      </div>
    );
  }
}




